import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/home/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login", //登录
    name: "login",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/register/login.vue"),
  },
  {
    path: "/ChangePassword", //修改密码
    name: "ChangePassword",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/register/ChangePassword.vue"
      ),
  },
  {
    path: "/pass", //登录
    name: "pass",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/register/pass.vue"),
  },
  {
    path: "/register", //注册
    name: "register",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/register/register.vue"
      ),
  },
  {
    path: "/pass", //忘记密码
    name: "pass",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/register/pass.vue"),
  },
  {
    path: "/register", //注册
    name: "register",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/register/register.vue"
      ),
  },
  {
    path: "/", //主页
    name: "home",
    component: HomeView,
  },
  {
    path: "/SettlementDoorOpening", //立即开门
    name: "SettlementDoorOpening",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/SettlementDoorOpening.vue"
      ),
  },
  {
    path: "/CarWashCalendar", //洗车日历
    name: "CarWashCalendar",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/CarWashCalendar.vue"
      ),
  },
  {
    path: "/Announcement", //平台公告
    name: "Announcement",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/PlatformAnnouncement.vue"
      ),
  },
  {
    path: "/addCar", //添加车辆
    name: "addCar",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/AddCar.vue"),
  },
  //我的-》 绑定门店路由
  {
    path: "/bindStore",
    name: "bindStore",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/BindStore.vue"),
  },
  {
    path: "/about", //公告信息和订单信息
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/SystemMessages.vue"
      ),
  },
  {
    path: "/successPay", //公告信息和订单信息
    name: "successPay",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited. successPay
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/SuccessPay.vue"),
  },
  {
    path: "/payment", //充值页面
    name: "payment",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/Payment.vue"),
  },
  {
    path: "/PayChooseStore", //充值页面 PayChooseStore
    name: "PayChooseStore",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/PayChooseStore.vue"
      ),
  },
  {
    path: "/message", //平台公告信息
    name: "message",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/Message.vue"),
  },
  {
    path: "/order", //订单信息
    name: "order",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/Order.vue"),
  },

  {
    path: "/myView",
    name: "myView",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/MyView.vue"),
  },
  {
    path: "/myOrder",
    name: "myOrder",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/MyOrder.vue"),
  },
  {
    path: "/nearByStores",
    name: "nearByStores",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/nearbyStores/nearByStores.vue"
      ),
  },
  {
    path: "/Comment",
    name: "Comment",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/nearbyStores/Comment.vue"
      ),
  },
  {
    path: "/myInfo",
    name: "myInfo",
    component: () => import("../views/my/MyInfo.vue"),
  },
  {
    path: "/vip",
    name: "/vip",
    component: () => import("../views/my/Vipcard.vue"),
  },
  {
    path: "/MyStores",
    name: "MyStores",
    component: () => import("../views/my/MyStores.vue"),
  },
  {
    path: "/Balance",
    name: "Balance",
    component: () => import("../views/my/Balance.vue"),
  },
  {
    path: "/detail",
    name: "detail",
    component: () => import("../views/my/Detail.vue"),
  },
  {
    path: "/integral",
    name: "integral",
    component: () => import("../views/my/Integral.vue"),
  },
  {
    path: "/detailIntegral",
    name: "detailIntegral",
    component: () => import("../views/my/DetailIntegral.vue"),
  },

  {
    path: "/information",
    name: "information",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/details/information.vue"
      ),
  },
  {
    path: "/Selectastore",
    name: "Selectastore",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/details/Selectastore.vue"
      ),
  },
  {
    path: "/map",
    name: "map",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/details/map.vue"),
  },
  {
    path: "/aaa",
    name: "aaa",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/aaa.vue"),
  },
  {
    path: "/Selectlicenseplate",
    name: "Selectlicenseplate",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/details/Selectlicenseplate.vue"
      ),
  },
  {
    path: "/Mycar",
    name: "Mycar",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/details/Mycar.vue"),
  },
  {
    path: "/Merchant",
    name: "Merchant",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/details/Merchant.vue"),
  },
  {
    path: "/fault",
    name: "fault",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/details/fault.vue"),
  },
  {
    path: "/alllibaray",
    name: "alllibaray",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/details/alllibaray.vue"
      ),
  },

  // 商城主页路由
  {
    path: "/store",
    name: "store",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/store/StoreView.vue"),
  },
  {
    path: "/AddressOrderEdit",
    name: "AddressOrderEdit",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/store/AddressOrderEdit.vue"
      ),
  },
  {
    path: "/singleOrder",
    name: "singleOrder",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/store/SingleOrder.vue"
      ),
  },
  {
    path: "/AddressOrder",
    name: "AddressOrder",
    // route level code-splitting AddressOrder
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/store/AddressOrder.vue"
      ),
  },
  // 商城主页路由
  {
    path: "/storeCheck",
    name: "storeCheck",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/store/StoreCheck.vue"),
  },
  // 商城模块：单个商品路由
  {
    path: "/singleCommodity",
    name: "singleCommodity",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/store/SingleCommodity.vue"
      ),
  },

  // 商城模块：商品评论路由
  {
    path: "/evaluate",
    name: "evaluate",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/store/Evaluate.vue"),
  },
  // 商城模块：商品立即兑换路由
  {
    path: "/order",
    name: "order",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/store/Order.vue"),
  },
  // 商城模块：商品支付路由
  {
    path: "/pay",
    name: "pay",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/store/WeixinPay.vue"),
  },

  //洗车教程
  {
    path: "/WashCarCourse",
    name: "WashCarCourse",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/WashCarCourse.vue"),
  },
  {
    path: "/BanandIngStore",
    name: "BanandIngStore",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/my/BanandIngStore.vue"
      ),
  },
  {
    path: "/IntegralStroe",
    name: "IntegralStroe",
    // route level code-splitting  IntegralStroe
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/IntegralStroe.vue"),
  },
  //服务协议
  {
    path: "/ServiceAgreement",
    name: "ServiceAgreement",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/my/ServiceAgreement.vue"
      ),
  },
  //操作指南
  {
    path: "/Instructions",
    name: "Instructions",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/Instructions.vue"),
  },
  //地址管理
  {
    path: "/AddressList",
    name: "AddressList",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/AddressList.vue"),
  },
  //地址编辑
  {
    path: "/AddressEdit",
    name: "AddressEdit",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/AddressEdit.vue"),
  },
  //关于我们
  {
    path: "/AboutUs",
    name: "AboutUs",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/AboutUs.vue"),
  },
  //设置
  {
    path: "/SystemSetting",
    name: "SystemSetting",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/SystemSetting.vue"),
  },
  //反馈意见
  {
    path: "/Feedback",
    name: "Feedback",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/my/Feedback.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
//可以多次点击同一个路径，放置项目冗余
const originalPush = VueRouter.prototype.push;

VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
// 结束
